home *** CD-ROM | disk | FTP | other *** search
- *** 1.12 1992/02/04 16:42:12
- --- Changelog 1992/03/06 19:37:53
- ***************
- *** 252,254 ****
- --- 252,270 ----
- the correct parameters.
-
- ---------------------------- Patchlevel 15 ------------------------------
- +
- + Makefile.tos:: Michal
- + use macros to make it easier to to adjust.
- +
- + atan2.c: mjr++
- + ccos.c:
- + cdiv.c:
- + cmult.c:
- + csin.c:
- + new assembler routines for both the sfp004 and the 881/882
- +
- + cadd.c: mjr++
- + csubt.c:
- + fixed nasty arg passing bug in the sfp code.
- +
- + ---------------------------- Patchlevel 16 ------------------------------
- *** 1.7 1992/02/03 20:22:27
- --- Makefile.tos 1992/03/06 19:37:54
- ***************
- *** 3,8 ****
- --- 3,12 ----
- CROSSBIN = $(CROSSDIR)/bin
- CROSSINC = $(CROSSDIR)/include
- XFLAGS = -Wstrict-prototypes
- + #this has to be gnu make
- + MAKE=make
- + CC=cgcc
- + AR=car
-
- ALL = pml16.olb pml.olb
-
- ***************
- *** 9,28 ****
- all : $(ALL)
-
- pml16.olb :
- ! make -f makefile.pml clean
- ! make -f makefile.pml CC="cgcc" AR="car" XFLAGS="$(XFLAGS)" s=true
-
- pml.olb :
- ! make -f makefile.pml clean
- ! make -f makefile.pml CC="cgcc" AR="car" XFLAGS="$(XFLAGS)"
-
- pml02016.olb :
- ! make -f makefile.pml clean
- ! make -f makefile.pml CC="cgcc -m68020" AR="car" XFLAGS="$(XFLAGS)" m=68881 s=true
-
- pml020.olb :
- ! make -f makefile.pml clean
- ! make -f makefile.pml CC="cgcc -m68020" AR="car" XFLAGS="$(XFLAGS)" m=68881
-
- install : $(ALL)
- cp pml16.olb pml.olb $(CROSSLIB)
- --- 13,34 ----
- all : $(ALL)
-
- pml16.olb :
- ! $(MAKE) -f makefile.pml clean
- ! $(MAKE) -f makefile.pml CC="$(CC)" AR="$(AR)" XFLAGS="$(XFLAGS)" s=true
-
- pml.olb :
- ! $(MAKE) -f makefile.pml clean
- ! $(MAKE) -f makefile.pml CC="$(CC)" AR="$(AR)" XFLAGS="$(XFLAGS)"
-
- pml02016.olb :
- ! $(MAKE) -f makefile.pml clean
- ! $(MAKE) -f makefile.pml CC="$(CC) -m68020" AR="$(AR)" \
- ! XFLAGS="$(XFLAGS)" m=68881 s=true
-
- pml020.olb :
- ! $(MAKE) -f makefile.pml clean
- ! $(MAKE) -f makefile.pml CC="$(CC) -m68020" AR="$(AR)" \
- ! XFLAGS="$(XFLAGS)" m=68881
-
- install : $(ALL)
- cp pml16.olb pml.olb $(CROSSLIB)
- ***************
- *** 33,41 ****
- cp math.h $(CROSSINC)
-
- clean:
- ! make -f makefile.pml clean
- ! make -f makefile.pml clean
-
- realclean:
- ! make -f makefile.pml realclean
- ! make -f makefile.pml realclean
- --- 39,47 ----
- cp math.h $(CROSSINC)
-
- clean:
- ! $(MAKE) -f makefile.pml clean
- ! $(MAKE) -f makefile.pml clean
-
- realclean:
- ! $(MAKE) -f makefile.pml realclean
- ! $(MAKE) -f makefile.pml realclean
- *** 1.12 1992/02/04 16:42:12
- --- PatchLevel.h 1992/03/06 19:37:54
- ***************
- *** 1,5 ****
- /*
- ! * PatchLevel: 15
- *
- * the Patch Level above is to identify the version
- * of the all the files in this directory. given the above
- --- 1,5 ----
- /*
- ! * PatchLevel: 16
- *
- * the Patch Level above is to identify the version
- * of the all the files in this directory. given the above
- *** 1.7 1992/02/03 20:19:23
- --- atan2.c 1992/03/06 19:37:56
- ***************
- *** 87,92 ****
- --- 87,94 ----
- *
- */
-
- + #if !defined (__M68881__) && !defined (sfp004)
- +
- #include <stdio.h>
- #include <math.h>
- #include "pml.h"
- ***************
- *** 124,126 ****
- --- 126,280 ----
- return (result);
- }
-
- + #endif !defined (__M68881__) && !defined (sfp004)
- + #ifdef __M68881__
- + __asm("
- + .text
- + .even
- + _funcname:
- + .ascii \"atan2\\0\"
- + .even
- +
- + .globl _atan2
- + _atan2:
- + | denormalized numbers are treated as 0
- + tstl sp@(12)
- + beq 5f | x == 0!
- + blt 1f | x < 0!
- + | x > 0: return atan(y/x)
- +
- + fmoved sp@(4)@,fp0 | get y
- + fdivd sp@(12),fp0 | y/x
- + fatanx fp0,fp0 | atan(y/x)
- + bra 3f | return
- + 1: | x < 0
- +
- + fmovecr #0,fp1 | get pi
- + fmoved sp@(4)@,fp0 | get y
- + fdivd sp@(12),fp0 | y/x
- + fatanx fp0,fp0 | atan(y/x)
- + btst #31,sp@(4) | sign(y)
- + beq 2f | positive!
- +
- + fnegx fp1,fp1 | transfer sign
- + 2: faddx fp1,fp0 | sign(y)*pi + atan(y/x)
- + | bra 3f | return
- + 3:
- + fmoved fp0,sp@- | return result
- + moveml sp@+,d0/d1
- + 4:
- + rts | sigh.
- + 5: | x == 0
- + movel #1073291771,d0 | pi/2
- + movel #1413754136,d1 |
- +
- + tstl sp@(4) |
- + beq 6f | NaN
- + bge 4b | exit
- + bset #31,d0 | x < 0 : return -pi/2
- + bra 4b
- + 6: movel #-1,d0 | NaN
- + movel #-1,d1 |
- + bra 4b
- + "); /* end asm */
- + #endif __M68881__
- +
- + #ifdef sfp004
- + __asm("
- +
- + comm = -6
- + resp = -16
- + zahl = 0
- +
- + .even
- + .text
- + .even
- + _funcname:
- + .ascii \"atan2\\0\"
- + .even
- + .text
- + .even
- + .globl _atan2
- + _atan2:
- + | denormalized numbers are treated as 0
- + lea 0xfffa50,a0
- + moveml a7@(12),d0-d1 | x
- + tstl d0
- + beq 5f | x == 0!
- + blt 1f | x < 0!
- + | x > 0: return atan(y/x)
- +
- + | fmoved sp@(4),fp0 | get y
- + movew #0x5400,a0@(comm)
- + .long 0x0c688900, 0xfff067f8
- + movel sp@(4),a0@
- + movel sp@(8),a0@
- +
- + | fdivd sp@(12),fp0 | y/x
- + movew #0x5420,a0@(comm)
- + .long 0x0c688900, 0xfff067f8
- + movel d0,a0@
- + movel d1,a0@
- +
- + | fatanx fp0,fp0 | atan(y/x)
- + movew #0x000a,a0@(comm)
- + .word 0x4a68,0xfff0,0x6bfa
- +
- + bra 3f | return
- + 1: | x < 0
- +
- + | fmovecr #0,fp1 | get pi
- + movew #0x5c80,a0@(comm)
- + .long 0x0c688900, 0xfff067f8
- +
- + | fmoved sp@(4),fp0 | get y
- + movew #0x5400,a0@(comm)
- + .long 0x0c688900, 0xfff067f8
- + movel sp@(4),a0@
- + movel sp@(8),a0@
- +
- + | fdivd sp@(12),fp0 | y/x
- + movew #0x5420,a0@(comm)
- + .long 0x0c688900, 0xfff067f8
- + movel d0,a0@
- + movel d1,a0@
- +
- + | fatanx fp0,fp0 | atan(y/x)
- + movew #0x000a,a0@(comm)
- + .word 0x4a68,0xfff0,0x6bfa
- +
- + btst #31,sp@(4) | sign(y)
- + beq 2f | positive!
- +
- + | fnegx fp1,fp1 | transfer sign
- + movew #0x049a,a0@(comm)
- + .word 0x4a68,0xfff0,0x6bfa
- +
- + 2:| faddx fp1,fp0 | sign(y)*pi + atan(y/x)
- + movew #0x0422,a0@(comm)
- + .word 0x4a68,0xfff0,0x6bfa
- +
- + | bra 3f | return
- + 3:
- + | fmoved fp0,d0-d1 | return result
- + movew #0x7400,a0@(comm)
- + .long 0x0c688900, 0xfff067f8
- + movel a0@,d0
- + movel a0@,d1
- +
- + 4:
- + rts | sigh.
- + 5: | x == 0
- + movel #1073291771,d0 | pi/2
- + movel #1413754136,d1 |
- +
- + tstl sp@(4) |
- + beq 6f | NaN
- + bge 4b | exit
- + bset #31,d0 | x < 0 : return -pi/2
- + bra 4b
- + 6: movel #-1,d0 | NaN
- + movel #-1,d1 |
- + bra 4b
- + "); /* end asm */
- + #endif sfp004
- *** 1.3 1992/02/03 20:19:23
- --- cadd.c 1992/03/06 19:37:57
- ***************
- *** 120,127 ****
-
- movew #0x5422,a0@(comm) | fp0 += z2.real
- .long 0x0c688900, 0xfff067f8
- ! movel a7@(4),a0@ | load arg_hi
- ! movel a7@(8),a0@ | load arg_low
-
- movew #0x5480,a0@(comm) | z1.imag -> fp1
- .long 0x0c688900, 0xfff067f8
- --- 120,127 ----
-
- movew #0x5422,a0@(comm) | fp0 += z2.real
- .long 0x0c688900, 0xfff067f8
- ! movel a7@(20),a0@ | load arg_hi
- ! movel a7@(24),a0@ | load arg_low
-
- movew #0x5480,a0@(comm) | z1.imag -> fp1
- .long 0x0c688900, 0xfff067f8
- ***************
- *** 129,138 ****
- movel a7@(16),a0@ | load arg_low
-
- movew #0x54a2,a0@(comm) | fp1 += z2.imag
- ! movel a1,d0 pointer to result
- .long 0x0c688900, 0xfff067f8
- ! movel a7@(4),a0@ | load arg_hi
- ! movel a7@(8),a0@ | load arg_low
-
- | movew #%0111 0101 0000 0000,a0@(comm) | fetch fp0
- movew #0x7400,a0@(comm) |
- --- 129,138 ----
- movel a7@(16),a0@ | load arg_low
-
- movew #0x54a2,a0@(comm) | fp1 += z2.imag
- ! movel a1,d0 | pointer to result
- .long 0x0c688900, 0xfff067f8
- ! movel a7@(28),a0@ | load arg_hi
- ! movel a7@(32),a0@ | load arg_low
-
- | movew #%0111 0101 0000 0000,a0@(comm) | fetch fp0
- movew #0x7400,a0@(comm) |
- *** 1.4 1992/02/03 20:19:23
- --- ccos.c 1992/03/06 19:37:58
- ***************
- *** 61,69 ****
- *
- */
-
- ! #if defined (__M68881__) && !defined (_M68881)
- ! /*# define _M68881*/
- ! #endif
-
- #include <stdio.h>
- #include <math.h>
- --- 61,67 ----
- *
- */
-
- ! #if !defined (__M68881__) && !defined (sfp004)
-
- #include <stdio.h>
- #include <math.h>
- ***************
- *** 79,81 ****
- --- 77,195 ----
- result.imag = -sin(z.real) * sinh(z.imag);
- return (result);
- }
- + #endif !defined (__M68881__) && !defined (sfp004)
- +
- + #ifdef __M68881__
- + __asm("
- + .text
- + _funcname:
- + .ascii \"ccos\\0\"
- + .even
- + .globl _ccos
- + _ccos:
- + movel a1,d0 | save a1 as return value
- + fmoved sp@(4),fp0 | z.real
- + fsinx fp0,fp1 | cos(z.real)
- + fcosx fp0,fp0 | sin(z.real)
- + fnegx fp1,fp1 |-sin(z.real)
- +
- + fmoved sp@(12),fp3 | z.imag
- + fcoshx fp3,fp2 | cosh(z.imag)
- + fsinhx fp3,fp3 | sinh(z.imag)
- +
- + fmulx fp2,fp0 | result.real
- + fmoved fp0,a1@ |
- + fmulx fp3,fp1 | result.imag
- + fmoved fp1,a1@(8) |
- + "); /* end asm */
- + #endif __M68881__
- +
- + #ifdef sfp004
- + __asm("
- + | double precision floating point stuff for Atari-gcc using the SFP004
- + | developed with gas
- + |
- + | double precision complex sin
- + |
- + | M. Ritzert (mjr at dmzrzu71)
- + |
- + | 12.10.1990
- + |
- + | addresses of the 68881 data port. This choice is fastest when much data is
- + | transferred between the two processors.
- +
- + comm = -6
- + resp = -16
- + zahl = 0
- +
- + | waiting loop ...
- + |
- + | wait:
- + | ww: cmpiw #0x8900,a1@(resp)
- + | beq ww
- + | is coded directly by
- + | .long 0x0c688900, 0xfff067f8
- + | and
- + | www: tst.b a1@(resp)
- + | bmi.b www
- + | is coded by
- + | .word 0x4a68,0xfff0,0x6bfa | test
- +
- + .text; .even
- + .globl _ccos
- + _ccos:
- + movel a1,d0 | save a1 as return value
- + lea 0xfffa50,a0 | fpu address
- +
- + movew #0x54b0,a0@(comm) | sincos: sin -> fp1
- + .long 0x0c688900, 0xfff067f8 | cos -> fp0
- + movel sp@(4), a0@ | load z.real
- + movel sp@(8), a0@ | load z.real
- +
- + | fmoved sp@(12),fp3 | z.imag to fp3
- + movew #0x5580,a0@(comm)
- + .long 0x0c688900, 0xfff067f8
- + movel sp@(12),a0@
- + movel sp@(16),a0@
- +
- + | fcoshx fp3,fp2 | cosh(z.imag)
- + movew #0x0d19,a0@(comm)
- + .word 0x4a68,0xfff0,0x6bfa | test
- + | fsinhx fp3,fp3 | sinh(z.imag)
- + movew #0x0d82,a0@(comm)
- + .word 0x4a68,0xfff0,0x6bfa | test
- + | fmulx fp2,fp0 | result.real
- + movew #0x0823,a0@(comm)
- + .word 0x4a68,0xfff0,0x6bfa | test
- + | fmoved fp0,a1@ |
- + movew #0x7400,a0@(comm) |
- + .long 0x0c688900, 0xfff067f8
- + movel a0@,a1@
- + movel a0@,a1@(4)
- + | fmulx fp3,fp1 | result.imag
- + movew #0x0ca3,a0@(comm)
- + .word 0x4a68,0xfff0,0x6bfa | test
- + | fnegx fp1,fp1
- + movew #0x049a,a0@(comm)
- + .word 0x4a68,0xfff0,0x6bfa | test
- + | fmoves fp1,d1 |
- + movew #0x7480,a0@(comm) |
- + .long 0x0c688900, 0xfff067f8
- + movel a0@,a1@(8)
- + movel a0@,a1@(12)
- + "); /* end asm */
- + #endif sfp004
- +
- +
- + #if defined (__M68881__) || defined (sfp004)
- + # ifdef ERROR_CHECK /* no error checking for now */
- + __asm("
- + pea _funcname
- + jmp c_err_check
- + "); /* end asm */
- + # else ERROR_CHECK
- +
- + __asm("rts");
- +
- + # endif ERROR_CHECK
- + #endif defined (__M68881__) || defined (sfp004)
- *** 1.3 1992/02/03 20:19:23
- --- cdiv.c 1992/03/06 19:37:59
- ***************
- *** 68,76 ****
- *
- */
-
- ! #if defined (__M68881__) && !defined (_M68881)
- ! /*# define _M68881*/
- ! #endif
-
- #include <stdio.h>
- #include <math.h>
- --- 68,74 ----
- *
- */
-
- ! #if !defined (__M68881__) && !defined (sfp004)
-
- #include <stdio.h>
- #include <math.h>
- ***************
- *** 114,116 ****
- --- 112,268 ----
- }
- return (result);
- }
- + #endif !defined (__M68881__) && !defined (sfp004)
- + #ifdef __M68881__
- + __asm("
- + .text
- + .even
- + _funcname:
- + .ascii \"cdiv\\0\"
- + .even
- +
- + .globl _cdiv
- + _cdiv:
- + fmoved sp@(4),fp0
- + fmoved sp@(12),fp1
- + fmoved sp@(20),fp2
- + fmoved sp@(28),fp3
- + fmovex fp0,fp4
- + movel a1,d0 | pointer to result
- +
- + fmovex fp2,fp5
- + fmulx fp2,fp5
- + fmovex fp3,fp6
- + fmulx fp3,fp6
- + faddx fp6,fp5
- +
- + fmulx fp2,fp4
- + fmulx fp3,fp0
- + fmulx fp1,fp2
- + fmulx fp1,fp3
- + faddx fp3,fp4
- + fdivx fp5,fp4
- + fsubx fp0,fp2
- + fdivx fp5,fp2
- +
- + fmoved fp4,a1@
- + fmoved fp2,a1@(8)
- + "); /* end asm */
- + #endif __M68881__
- +
- + #ifdef sfp004
- + __asm("
- +
- + comm = -6
- + resp = -16
- + zahl = 0
- +
- + .even
- + .text
- + .even
- + _funcname:
- + .ascii \"cdiv\\0\"
- + .even
- + .text
- + .even
- + .globl _cdiv
- + _cdiv:
- +
- + lea 0xfffa50,a0
- +
- + movew #0x5400,a0@(comm) | z1.real -> fp0
- + movel a1,d0 | pointer to result
- + .long 0x0c688900, 0xfff067f8
- + movel a7@(4),a0@ | load arg_hi
- + movel a7@(8),a0@ | load arg_low
- +
- + movew #0x5480,a0@(comm) | z1.imag -> fp1
- + .long 0x0c688900, 0xfff067f8
- + movel a7@(12),a0@ | load arg_hi
- + movel a7@(16),a0@ | load arg_low
- +
- + movew #0x5500,a0@(comm) | z2.real -> fp2
- + .long 0x0c688900, 0xfff067f8
- + movel a7@(20),a0@ | load arg_hi
- + movel a7@(24),a0@ | load arg_low
- +
- + movew #0x5580,a0@(comm) | z2.imag -> fp3
- + .long 0x0c688900, 0xfff067f8
- + movel a7@(28),a0@ | load arg_hi
- + movel a7@(32),a0@ | load arg_low
- +
- + movew #0x0200,a0@(comm) | copy fp0 to fp4
- + .word 0x4a68,0xfff0,0x6bfa | test
- +
- +
- + | fmovex fp2,fp5
- + movew #0x0a80,a0@(comm)
- + .word 0x4a68,0xfff0,0x6bfa | test
- + | fmulx fp2,fp5
- + movew #0x0aa3,a0@(comm)
- + .word 0x4a68,0xfff0,0x6bfa | test
- + | fmovex fp3,fp6
- + movew #0x0f00,a0@(comm)
- + .word 0x4a68,0xfff0,0x6bfa | test
- + | fmulx fp3,fp6
- + movew #0x0f23,a0@(comm)
- + .word 0x4a68,0xfff0,0x6bfa | test
- + | faddx fp6,fp5
- + movew #0x1aa2,a0@(comm)
- + .word 0x4a68,0xfff0,0x6bfa | test
- +
- + | fmulx fp2,fp4
- + movew #0x0a23,a0@(comm)
- + .word 0x4a68,0xfff0,0x6bfa | test
- + | fmulx fp3,fp0
- + movew #0x0c23,a0@(comm)
- + .word 0x4a68,0xfff0,0x6bfa | test
- + | fmulx fp1,fp2
- + movew #0x0523,a0@(comm)
- + .word 0x4a68,0xfff0,0x6bfa | test
- + | fmulx fp1,fp3
- + movew #0x05a3,a0@(comm)
- + .word 0x4a68,0xfff0,0x6bfa | test
- +
- + | faddx fp3,fp4
- + movew #0x0e22,a0@(comm)
- + .word 0x4a68,0xfff0,0x6bfa | test
- + | fdivx fp5,fp4
- + movew #0x1620,a0@(comm)
- + .word 0x4a68,0xfff0,0x6bfa | test
- + | fsubx fp0,fp2
- + movew #0x0128,a0@(comm)
- + .word 0x4a68,0xfff0,0x6bfa | test
- + | fdivx fp5,fp2
- + movew #0x1520,a0@(comm)
- + .word 0x4a68,0xfff0,0x6bfa | test
- +
- +
- + | fmoved fp4,a1@
- + movew #0x7600,a0@(comm) |
- + .long 0x0c688900, 0xfff067f8
- + movel a0@,a1@
- + movel a0@,a1@(4)
- +
- + | fmoved fp2,a1@(8)
- + movew #0x7500,a0@(comm) |
- + .long 0x0c688900, 0xfff067f8
- + movel a0@,a1@(8)
- + movel a0@,a1@(12)
- + "); /* end asm */
- + #endif sfp004
- +
- + #if defined (__M68881__) || defined (sfp004)
- + # ifdef ERROR_CHECK /* no error checking for now */
- +
- + __asm("
- + pea _funcname
- + jmp c_err_check
- + "); /* end asm */
- +
- + # else ERROR_CHECK
- +
- + __asm("rts");
- +
- + # endif ERROR_CHECK
- + #endif defined (__M68881__) || defined (sfp004)
- *** 1.3 1992/02/03 20:19:23
- --- cmult.c 1992/03/06 19:38:00
- ***************
- *** 62,70 ****
- *
- */
-
- ! #if defined (__M68881__) && !defined (_M68881)
- ! /*# define _M68881*/
- ! #endif
-
- #include <stdio.h>
- #include <math.h>
- --- 62,68 ----
- *
- */
-
- ! #if !defined (__M68881__) && !defined (sfp004)
-
- #include <stdio.h>
- #include <math.h>
- ***************
- *** 81,83 ****
- --- 79,203 ----
-
- return (result);
- }
- + #endif !defined (__M68881__) && !defined (sfp004)
- + #ifdef __M68881__
- + __asm("
- + .text
- + .even
- + _funcname:
- + .ascii \"cmult\\0\"
- + .even
- +
- + .globl _cmult
- + _cmult:
- + fmoved sp@(4),fp0
- + fmoved sp@(12),fp1
- + fmoved sp@(20),fp2
- + fmoved sp@(28),fp3
- + fmovex fp0,fp4
- + movel a1,d0 | pointer to result
- +
- + fmulx fp2,fp4
- + fmulx fp3,fp0
- + fmulx fp1,fp2
- + fmulx fp1,fp3
- +
- + fsubx fp3,fp4
- + faddx fp0,fp2
- +
- + fmoved fp4,a1@
- + fmoved fp2,a1@(8)
- + "); /* end asm */
- + #endif __M68881__
- +
- + #ifdef sfp004
- + __asm("
- +
- + comm = -6
- + resp = -16
- + zahl = 0
- +
- + .even
- + .text
- + .even
- + _funcname:
- + .ascii \"cmult\\0\"
- + .even
- + .text
- + .even
- + .globl _cmult
- + _cmult:
- +
- + lea 0xfffa50,a0
- +
- + movew #0x5400,a0@(comm) | z1.real -> fp0
- + movel a1,d0 | pointer to result
- + .long 0x0c688900, 0xfff067f8
- + movel a7@(4),a0@ | load arg_hi
- + movel a7@(8),a0@ | load arg_low
- +
- + movew #0x5480,a0@(comm) | z1.imag -> fp1
- + .long 0x0c688900, 0xfff067f8
- + movel a7@(12),a0@ | load arg_hi
- + movel a7@(16),a0@ | load arg_low
- +
- + movew #0x5500,a0@(comm) | z2.real -> fp2
- + .long 0x0c688900, 0xfff067f8
- + movel a7@(20),a0@ | load arg_hi
- + movel a7@(24),a0@ | load arg_low
- +
- + movew #0x5580,a0@(comm) | z2.imag -> fp3
- + .long 0x0c688900, 0xfff067f8
- + movel a7@(28),a0@ | load arg_hi
- + movel a7@(32),a0@ | load arg_low
- +
- + movew #0x0200,a0@(comm) | copy fp0 to fp4
- + .word 0x4a68,0xfff0,0x6bfa | test
- +
- + | fmulx fp2,fp4
- + movew #0x0a23,a0@(comm)
- + .word 0x4a68,0xfff0,0x6bfa | test
- + | fmulx fp3,fp0
- + movew #0x0c23,a0@(comm)
- + .word 0x4a68,0xfff0,0x6bfa | test
- + | fmulx fp1,fp2
- + movew #0x0523,a0@(comm)
- + .word 0x4a68,0xfff0,0x6bfa | test
- + | fmulx fp1,fp3
- + movew #0x05a3,a0@(comm)
- + .word 0x4a68,0xfff0,0x6bfa | test
- + | fsubx fp3,fp4
- + movew #0x0e28,a0@(comm)
- + .word 0x4a68,0xfff0,0x6bfa | test
- + | faddx fp0,fp2
- + movew #0x0122,a0@(comm)
- + .word 0x4a68,0xfff0,0x6bfa | test
- +
- + | fmoved fp4,a1@
- + movew #0x7600,a0@(comm) |
- + .long 0x0c688900, 0xfff067f8
- + movel a0@,a1@
- + movel a0@,a1@(4)
- +
- + | fmoved fp2,d1
- + movew #0x7500,a0@(comm) |
- + .long 0x0c688900, 0xfff067f8
- + movel a0@,a1@(8)
- + movel a0@,a1@(12)
- + "); /* end asm */
- + #endif sfp004
- +
- + #if defined (__M68881__) || defined (sfp004)
- + # ifdef ERROR_CHECK /* no error checking for now */
- +
- + __asm("
- + pea _funcname
- + jmp c_err_check
- + "); /* end asm */
- +
- + # else ERROR_CHECK
- +
- + __asm("rts");
- +
- + # endif ERROR_CHECK
- + #endif defined (__M68881__) || defined (sfp004)
- *** 1.4 1992/02/03 20:19:23
- --- csin.c 1992/03/06 19:38:01
- ***************
- *** 61,69 ****
- *
- */
-
- ! #if defined (__M68881__) && !defined (_M68881)
- ! /*# define _M68881*/
- ! #endif
-
- #include <stdio.h>
- #include <math.h>
- --- 61,67 ----
- *
- */
-
- ! #if !defined (__M68881__) && !defined (sfp004)
-
- #include <stdio.h>
- #include <math.h>
- ***************
- *** 78,80 ****
- --- 76,190 ----
- result.imag = cos (z.real) * sinh (z.imag);
- return (result);
- }
- + #endif !defined (__M68881__) && !defined (sfp004)
- +
- + #ifdef __M68881__
- + __asm("
- + .text
- + _funcname:
- + .ascii \"csin\\0\"
- + .even
- + .globl _csin
- + _csin:
- + movel a1,d0 | save a1 as return value
- + fmoved sp@(4),fp0 | z.real
- + fcosx fp0,fp1 | cos(z.real)
- + fsinx fp0,fp0 | sin(z.real)
- +
- + fmoved sp@(12),fp3 | z.imag
- + fcoshx fp3,fp2 | cosh(z.imag)
- + fsinhx fp3,fp3 | sinh(z.imag)
- +
- + fmulx fp2,fp0 | result.real
- + fmoved fp0,a1@ |
- + fmulx fp3,fp1 | result.imag
- + fmoved fp1,a1@(8) |
- + "); /* end asm */
- + #endif __M68881__
- +
- + #ifdef sfp004
- + __asm("
- + | double precision floating point stuff for Atari-gcc using the SFP004
- + | developed with gas
- + |
- + | double precision complex sin
- + |
- + | M. Ritzert (mjr at dmzrzu71)
- + |
- + | 12.10.1990
- + |
- + | addresses of the 68881 data port. This choice is fastest when much data is
- + | transferred between the two processors.
- +
- + comm = -6
- + resp = -16
- + zahl = 0
- +
- + | waiting loop ...
- + |
- + | wait:
- + | ww: cmpiw #0x8900,a1@(resp)
- + | beq ww
- + | is coded directly by
- + | .long 0x0c688900, 0xfff067f8
- + | and
- + | www: tst.b a1@(resp)
- + | bmi.b www
- + | is coded by
- + | .word 0x4a68,0xfff0,0x6bfa | test
- +
- + .text; .even
- + .globl _csin
- + _csin:
- + movel a1,d0 | save a1 as return value
- + lea 0xfffa50,a0 | fpu address
- +
- + movew #0x5431,a0@(comm) | sincos: sin -> fp0
- + .long 0x0c688900, 0xfff067f8 | cos -> fp1
- + movel sp@(4), a0@ | load z.real
- + movel sp@(8), a0@ | load z.real
- +
- + | fmoved sp@(12),fp3 | z.imag to fp3
- + movew #0x5580,a0@(comm)
- + .long 0x0c688900, 0xfff067f8
- + movel sp@(12),a0@
- + movel sp@(16),a0@
- +
- + | fcoshx fp3,fp2 | cosh(z.imag)
- + movew #0x0d19,a0@(comm)
- + .word 0x4a68,0xfff0,0x6bfa | test
- + | fsinhx fp3,fp3 | sinh(z.imag)
- + movew #0x0d82,a0@(comm)
- + .word 0x4a68,0xfff0,0x6bfa | test
- + | fmulx fp2,fp0 | result.real
- + movew #0x0823,a0@(comm)
- + .word 0x4a68,0xfff0,0x6bfa | test
- + | fmoved fp0,a1@ |
- + movew #0x7400,a0@(comm) |
- + .long 0x0c688900, 0xfff067f8
- + movel a0@,a1@
- + movel a0@,a1@(4)
- + | fmulx fp3,fp1 | result.imag
- + movew #0x0ca3,a0@(comm)
- + .word 0x4a68,0xfff0,0x6bfa | test
- + | fmoves fp1,d1 |
- + movew #0x7480,a0@(comm) |
- + .long 0x0c688900, 0xfff067f8
- + movel a0@,a1@(8)
- + movel a0@,a1@(12)
- + "); /* end asm */
- + #endif sfp004
- +
- +
- + #if defined (__M68881__) || defined (sfp004)
- + # ifdef ERROR_CHECK /* no error checking for now */
- + __asm("
- + pea _funcname
- + jmp c_err_check
- + "); /* end asm */
- + # else ERROR_CHECK
- +
- + __asm("rts");
- +
- + # endif ERROR_CHECK
- + #endif defined (__M68881__) || defined (sfp004)
- *** 1.3 1992/02/03 20:19:23
- --- csubt.c 1992/03/06 19:38:02
- ***************
- *** 124,131 ****
-
- movew #0x5428,a0@(comm) | fp0 -= z2.real
- .long 0x0c688900, 0xfff067f8
- ! movel a7@(4),a0@ | load arg_hi
- ! movel a7@(8),a0@ | load arg_low
-
- movew #0x5480,a0@(comm) | z1.imag -> fp1
- .long 0x0c688900, 0xfff067f8
- --- 124,131 ----
-
- movew #0x5428,a0@(comm) | fp0 -= z2.real
- .long 0x0c688900, 0xfff067f8
- ! movel a7@(20),a0@ | load arg_hi
- ! movel a7@(24),a0@ | load arg_low
-
- movew #0x5480,a0@(comm) | z1.imag -> fp1
- .long 0x0c688900, 0xfff067f8
- ***************
- *** 133,142 ****
- movel a7@(16),a0@ | load arg_low
-
- movew #0x54a8,a0@(comm) | fp1 -= z2.imag
- ! movel a1,d0 pointer to result
- .long 0x0c688900, 0xfff067f8
- ! movel a7@(4),a0@ | load arg_hi
- ! movel a7@(8),a0@ | load arg_low
-
- | movew #%0111 0101 0000 0000,a0@(comm) | fetch fp0
- movew #0x7400,a0@(comm) |
- --- 133,142 ----
- movel a7@(16),a0@ | load arg_low
-
- movew #0x54a8,a0@(comm) | fp1 -= z2.imag
- ! movel a1,d0 | pointer to result
- .long 0x0c688900, 0xfff067f8
- ! movel a7@(28),a0@ | load arg_hi
- ! movel a7@(32),a0@ | load arg_low
-
- | movew #%0111 0101 0000 0000,a0@(comm) | fetch fp0
- movew #0x7400,a0@(comm) |
-